package common;

import model.room.Room;
import model.user.User;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * @author mxd
 * @date 2024/5/29 0029
 */
public class InitUser {

    public static void main(String[] args) {

        String filename = "project/src/common/users.txt";  //文件路径
        User.getUsers().add(new User("李苏华","18997324566","31456478658589","1","12345"));
        User.getUsers().add(new User("马小东","13797856666","63012120010801","2","123456"));
        User.getUsers().add(new User("孟晗","15358604520","314561216546545","3","1234567"));
        User.getUsers().add(new User("莫莹影","13619468888","1546545262565","4","12345678"));
        User.getUsers().add(new User("马世鹏","13524585555","1345665558526","5","123456789"));


        //将users集合保存在指定文件中
        try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(filename))) {
            out.writeObject(User.getUsers());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}